from django import template
from django.conf import settings

register = template.Library()

# settings value
@register.simple_tag
def settings_value(name):
    return getattr(settings, name, "")

def catalog_menu(context):
    from catalog.models import Category, OperatinSystem
    request = context["request"]
    context.update({ 'os_items': OperatinSystem.objects.all() })
    #cur_os = context.get("os")
    #cur_cat = context.get("category")
    return context
register.inclusion_tag("catalog/menu.html", takes_context=True)(catalog_menu)